package com.netflexitysolutions.amazonws.ec2;

import java.util.HashMap;
import java.util.Map;

public enum SnapshotStatus {
	
	PENDING("pending"), COMPLETED("completed");
	
	private static Map<String, SnapshotStatus> statusByName = new HashMap<String, SnapshotStatus>();
	
	static {
		SnapshotStatus[] statuses = SnapshotStatus.values();
		for (SnapshotStatus status : statuses) {
			statusByName.put(status.getName(), status);
		}
	}
	
	public static SnapshotStatus snapshotStatusForName(String name) {
		return statusByName.get(name);
	}
	
	private String name;
	
	private SnapshotStatus(String name) {
		this.name = name;
	}
	
	public String getName() {
		return name;
	}
	
}
